<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
    <title>襄阳蓝芯智能化办公系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="${pageContext.request.contextPath}/static/bootstrap-3.3.5/css/bootstrap.css" rel="stylesheet">
    <style>
        .thead-blue {
            color: #fff;
            font-weight: bold;
            background-color: #337ab7;
        }
    </style>
</head>
<body>

<div class="panel panel-primary">
    <table class="table table-bordered table-hover">
        <thead>
        <tr class="thead-blue">
            <td colspan="4">移动申请单详情</td>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td class="col-md-2"><label>申请单号</label></td>
            <td class="col-md-4">${main.docNo}</td>
            <td class="col-md-2"><label>审批流程</label></td>
            <td class="col-md-4">${flowName}</td>
        </tr>
        <tr>
            <td><label>创建人</label></td>
            <td>${creatorName}</td>
            <td><label>单据类型</label></td>
            <td>${main.doctype}</td>
        </tr>
        <tr>
            <td><label>申请人</label></td>
            <td>${proposerName}</td>
            <td><label>申请时所在部门</label></td>
            <td>${deptName}</td>
        </tr>
        <tr>
            <td><label>创建时间</label></td>
            <td>${main.createDate}</td>
            <td><label>提交时间</label></td>
            <td>${main.submitDate}</td>
        </tr>
        <tr>
            <td><label>移动事由</label></td>
            <td>${reasonName}</td>
            <td><label>单据状态</label></td>
            <td>
                <c:choose>
                    <c:when test="${main.status == 'W'}">未提交</c:when>
                    <c:when test="${main.status == 'O'}">审批中</c:when>
                    <c:when test="${main.status == 'Y'}">审批通过待办理</c:when>
                    <c:when test="${main.status == 'N'}">审批不通过</c:when>
                    <c:when test="${main.status == 'S'}">已办理</c:when>
                    <c:otherwise>${main.status}</c:otherwise>
                </c:choose>
            </td>
        </tr>
        <tr>
            <td><label>备注</label></td>
            <td colspan="3">${main.remark}</td>
        </tr>

        <c:forEach items="${details}" var="detail" varStatus="status">
            <tr class="thead-blue">
                <td colspan="4">移动明细(${status.count})</td>
            </tr>
            <tr>
                <td><label>资产名称</label></td>
                <td>${detail.asset.assetName}</td>
                <td><label>序列号</label></td>
                <td>${detail.asset.assetNumber}</td>
            </tr>
            <tr>
                <td><label>原存放地</label></td>
                <td>${detail.storage.name}</td>
                <td><label>移动目的地</label></td>
                <td>${detail.targetPlaceObj.name}</td>
            </tr>
            <tr>
                <td><label>原保管人</label></td>
                <td>${detail.keeper.empName}</td>
                <td><label>采购时间</label></td>
                <td>${detail.asset.createDate}</td>
            </tr>
            <tr>
                <td><label>备注</label></td>
                <td colspan="3">${detail.remark}</td>
            </tr>
        </c:forEach>

        <tr>
            <td colspan="4" align="center">
                <a type="button" href="javascript:history.back()" class="btn btn-info">返回</a>
                <c:if test="${s == 'banli'}">
                    <button type="button" onclick="location.href='${pageContext.request.contextPath}/zc-assetmoveapply/doAssetMove?oid=${oid}'" class="btn btn-success">办理移动</button>
                </c:if>
            </td>
        </tr>
        </tbody>
    </table>
</div>

<script src="${pageContext.request.contextPath}/static/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
    $(document).ajaxError(function(event,xhr) {
        if(xhr.status=="403"){//没有权限
            document.location.href = xhr.getResponseHeader("url");
        }else if(xhr.status!="200"){
            console.log("服务器错误!");
        }
    });
</script>
</body>
</html>